home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / sound / rukq10.zip / RUCKMIDI.DOC < prev    next >
Text File  |  1993-02-15  |  81KB  |  2,641 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.      RUCKUS-MIDI Copyright (C)1993 Cornel Huth
  8.      Documentation Copyright (C)1993 Cornel Huth
  9.      All Rights Reserved.
  10.  
  11.      Version 1.00. 
  12.  
  13.      For ordering information, license agreement, and product support
  14.      information, see Appendix Z.
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.      Introduction
  74.  
  75.      RUCKUS-MIDI is one part of the RUCKUS sound toolkit for DOS programmers.
  76.      Its forte is its ability to play MIDI data in three different formats.
  77.      Standard MIDI file format, type-0 and type-1 with selectable programs of
  78.      the General MIDI Sound Set, the MT-32, or one of the programmer's choosing.
  79.      Also supported is the CMF type (Creative Music File format, similar to
  80.      Standard MIDI) and ROL-converted MIDI type (ROL is the file type used by
  81.      the AdLib MSC). The other part of the RUCKUS sound toolkit is RUCKUS-DAC.
  82.      Its forte is its ability to play and record digital data in three formats:
  83.      VOC, WAVE, and Amiga Module. See RUCKUS-DAC for more.
  84.  
  85.      RUCKUS-MIDI currently supports the AdLib MSC and compatibles. This includes
  86.      all Sound Blasters and its clones, as well. RUCKUS-MIDI is implemented to
  87.      be device-independent. As new sound hardware (with supporting
  88.      documentation) becomes available to this programmer, it will be added. The
  89.      code you write to play MIDI music using RUCKUS will play on any new device
  90.      added later without any code changes to your program. You just supply the
  91.      new device ID (see InitMidi for more). RUCKUS-DAC already supports several
  92.      sound devices in a device-independent manner.
  93.  
  94.      The RUCKUS toolkit supports most DOS compilers as is. This documentation
  95.      describes using RUCKUS with BASIC DOS compilers. Also available is a C-
  96.      specific version of this documentation. Other implementations should be
  97.      able to get the necessary details using this documentation. Note that these
  98.      toolkits will not work with the current or past Turbo Pascal compilers.
  99.      This is due to Turbo Pascal's proprietary linkage methods.
  100.  
  101.      To provide compiler-independence, RUCKUS (and all of my latest toolkits)
  102.      implements a simple calling scheme: a single far pointer is passed to
  103.      RUCKUS. The data structure that is pointed to varies depending on RUCKUS
  104.      function. There are 11 structure types ("packs") currently. The first two
  105.      data members of each pack are identical in all packs. These are Func and
  106.      Stat. The remaining members, if any, vary depending on requirements. For
  107.      instance, the LoadMidi routine uses, in addition to Func and Stat, four
  108.      additional members: FilenamePtr, StartPos, LoadSize, and LoadPtr. The steps
  109.      needed to load a MIDI data file to memory would be as follows:
  110.  
  111.  
  112.           1. Allocate pack. Packs are reusable and can be allocated any way you
  113.           want. Here we make a static allocation for simplicity.
  114.  
  115.           DIM LMP AS LoadMidiPackTYPE
  116.  
  117.           2. Assign member values:
  118.       
  119.           filenameZ$ = file$ + CHR$(0)  'must terminate string with 0
  120.           LMP.Func = LoadMidi
  121.           LMP.FilenamePtr = SADD(filenameZ$)  
  122.           LMP.FilenamePtrSeg = VARSEG(filenameZ$)
  123.           'LMP.FilenamePtrSeg = SSEG(filenameZ$)  'for BASIC7/VBDOS
  124.           LMP.StartPos = 0&                    
  125.           LMP.LoadSize = 0&
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           3. Call RUCKUS:
  140.  
  141.           stat = RUCKMIDI(LMP)
  142.  
  143.           4. On return from the call:
  144.  
  145.           IF stat = 0 THEN 
  146.              ' LMP.LoadPtr -> address of MIDI data in memory
  147.  
  148.      After the load you can immediately call the PlayMidi routine using the
  149.      lmp.LoadPtr returned from the Load call. You don't need to use the RUCKUS
  150.      LoadMidi routine; you can perform your own MIDI data file loads to memory.
  151.      However, RUCKUS can load up to 32 separate MIDI data files at one time and
  152.      performs all the necessary memory allocations and deallocations
  153.      automatically. See LoadMidi for more.
  154.  
  155.      As you can see, using RUCKUS is easy. If you'd rather use a traditional 
  156.      calling convention, wrap the RUCKUS routines in a BASIC function and call
  157.      it as you normally would, i.e., stat = LoadMidiFile(file$,LMP) where
  158.      LoadMidi contains the actual code (as shown above).
  159.  
  160.      Now that I have your interest, let me tell you why I've provided this
  161.      toolkit for you. Shareware. That's right. Shareware. What I've done is
  162.      provide you with a means to evaluate this product completely, with no
  163.      upfront obligations. If you can't make use of this product, no problem.
  164.      Think of this as the ultimate return policy. You can actually take the
  165.      goods home, try it out, break it in. Then, if after a period of no more
  166.      than 21 days, you feel that this product is well worth the price I'm
  167.      asking, by all means, you should go ahead and fill out the order form and
  168.      send it in. If you do not register, then of course, it means the product is
  169.      not something you can use. If you can't use it, I don't want your money.
  170.      But if it's something you will use, it's only fair that you register. The
  171.      PROFESSIONAL registered versions does not have any built-in advertising
  172.      screens. The PERSONAL DEVELOPER registered version does display a sign-on
  173.      banner once. See Appendix Z. for ordering options and other related
  174.      information specific to this product.
  175.  
  176.      The documentation that follows describes each of the function routines as
  177.      to use, pack type used, and sample code in BASIC. Also available is a C
  178.      version of this toolkit, differing only in example programs and
  179.      documentation*. For additional source examples see the included X files on
  180.      disk.
  181.  
  182.      *There is a specific object module that must be used with any Borland C
  183.      compiler, but this LIB will work for other C compilers.
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.      RUCKUS-MIDI Functions.
  206.  
  207.       0. SysInfoMidi ...........................................  5
  208.       1. InitMidi ..............................................  6
  209.       2. ExitMidi ..............................................  7
  210.       3. AtExitMidi ............................................  8
  211.       4. LoadMidi ..............................................  9
  212.       5. PlayMidi .............................................. 10
  213.          6 and 7 are not used
  214.       8. EndMidi ............................................... 11
  215.       9. PauseMidi ............................................. 12
  216.      10. DeallocMidi ........................................... 13
  217.      11. FastFwdMidi ........................................... 14
  218.      12. OutMsgMidi ............................................ 15
  219.          13 to 19 are not used 
  220.      20. SetAllMidi ............................................ 16
  221.      21. SetVolumeMidi ......................................... 17
  222.      22. SetToneMidi ........................................... 18
  223.      23. SetPatchMidi .......................................... 19
  224.      24. SetChMaskMidi ......................................... 20
  225.          25 to 29 are not used
  226.      30. SetAllFMSBP ........................................... 21
  227.  
  228.          Appendix A. Tips and Tricks ........................... 22
  229.          Appendix B. Pack Structure ............................ 23
  230.          Appendix C. Compiler, Linker, QLB, and Call Use ....... 26
  231.          Appendix D. RUCKUS-MIDI Data Area ..................... 28
  232.          Appendix E. Key#, Frequencies and Channel Messages .... 30
  233.          Appendix F. General MIDI Sound Set .................... 32
  234.          Appendix G. MT-32 Sound Set ........................... 34
  235.          Appendix H. Patch Map Format .......................... 36
  236.          Appendix Z. Ordering Information, License Agreement
  237.                      and Product Support........................ 38
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.      SysInfoMidi         Func: 0        Pack: SysInfoMidiPack
  272.  
  273.  
  274.      Determine which RUCKUS-supported devices are available on the current
  275.      machine. Information returned on detected devices includes base I/O port
  276.      and channel information (a mask indicating available channels). 
  277.  
  278.      SysInfoMidi may be called only if no RUCKUS-MIDI device is active. If you
  279.      an active device (via InitMidi), perform an ExitMidi before calling this
  280.      function.
  281.  
  282.  
  283.      RUCKUS-MIDI currently supports the following devices:
  284.  
  285.      Device ID
  286.  
  287.           0         AdLib melodic, MIDI channels 0 to 8.
  288.                     Does not support mappable drum channel.
  289.  
  290.           1         AdLib percussive, MIDI channels 0 to 5, and 9.
  291.                     The drum channel (9) is programmer-selectable and 
  292.                     it maps to the 5 additional percussive voices.
  293.  
  294.           2*        OPL-3 percussive, MIDI channels 0 to 15.
  295.                     The drum channel (9) is programmer-selectable and
  296.                     it maps to the 5 additional percussive voices.
  297.  
  298.           3*        OPL-3 percussive, MIDI channels 0 to 8, and 9.
  299.                     The drum channel (9) is programmer-selectable and
  300.                     it maps to the 5 additional percussive voices.
  301.                     4-operator timbre data for channels 0 to 5, and 
  302.                     2-operator timbre data for channels 6 to 8.
  303.  
  304.           4*        UltraSound (GUS), MIDI channels 0 to 15, and 9.
  305.                     The drum channel (9) is programmer-selectable.
  306.  
  307.                * Devices 2, 3, and 4 are currently not supported but will be
  308.                available in the future.
  309.  
  310.      Sample Use:
  311.  
  312.      DIM SIMP AS SysInfoMidiPackTYPE
  313.  
  314.      SIMP.Func = SysInfoMidi
  315.      stat = RUCKMIDI(SIMP)
  316.      IF stat = 0 THEN
  317.         'SIMP.Device0 is 1 if AdLib melodic mode available
  318.         'if above then SIMP.D0port is 388h
  319.         '              SIMP.D0mask is 1FFh
  320.         'SIMP.Device1 is 1 if AdLib percussive mode available
  321.         'if above then SIMP.D1port is 388h
  322.         '              SIMP.D1mask is 23Fh
  323.  
  324.  
  325.  
  326.                                                                                5
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.      InitMidi            Func: 1        Pack: mInitMidiPack
  338.  
  339.  
  340.      Initialize the RUCKUS-MIDI system to the following:
  341.  
  342.      DeviceID  - any of the supported devices found by SysInfoMidi.
  343.      IOport    - the base I/O port as reported by SysInfoMidi.
  344.      PercCh    - the channel to use for percussion mapping.
  345.      ChMask    - the 16-bit mask as reported by SysInfoMidi.
  346.      Flags     - additional options.
  347.  
  348.      No RUCKUS-MIDI routines can be called prior InitMidi except SysInfoMidi and
  349.      SetAllFMSBP.
  350.  
  351.      On return from a successful initialization, two segmented far pointers are
  352.      returned: InfoPtr and MidiExitPtr. 
  353.  
  354.      InfoPtr is used to locate the RUCKUS-MIDI data area for use with compilers
  355.      that do not handle external variable references (such as QuickBASIC). Other
  356.      compilers (such as C7) can reference RUCKUS-MIDI data directly since the
  357.      references are public. See Appendix D. for more on RUCKUS-MIDI data.
  358.  
  359.      MidiExitPtr is used for those development systems that do not have direct
  360.      support for the ANSI _atexit procedure. MidiExitPtr is a function pointer
  361.      (far pointer -> MidiExit) of the routine that should be called before
  362.      termination of any program that uses RUCKUS-MIDI. Most development systems
  363.      do provide for _atexit since it provides for orderly program shutdown in
  364.      the case of abnormal termination. For those that don't, you must include
  365.      the stub object module NOATEXIT.OBJ. See Appendix C. for more information.
  366.  
  367.      Sample Use:
  368.  
  369.      DEFINT A-Z                    'NOTE: All BASIC examples assume DEFINT A-Z
  370.      DIM MIMP AS mInitMidiPackTYPE
  371.  
  372.      MIMP.Func = InitMidi  'see Appendix B. Pack Structure for more
  373.      MIMP.DeviceID = 1
  374.      MIMP.IOport = &H388
  375.      MIMP.PercCh = 9
  376.      MIMP.ChMask = &H23F   '0000 00P0 0011 1111 binary (P=perc channel)
  377.      MIMP.Flags = 0        'see Appendix D. for bitmap of flags
  378.      stat = RUCKMIDI(MIMP)
  379.      IF stat = 0 THEN
  380.         'MIMP.InfoPtrOff is offset address to start of RUCKUS-MIDI data area
  381.         'MIMP.InfoPtrSeg is segment
  382.         'MIMP.MidiExitPtrOff is offset address to ExitMidi routine
  383.         'MIMP.MidiExitPtrSeg is segment 
  384.  
  385.         'sample use of InfoPtr
  386.         'PEEKW/D() is like PEEK but reads 2/4-byte words (see Appendix A.)
  387.         DEF SEG = MIMP.InfoPtrSeg
  388.         DosMemoryAvailK = PEEKW(InfoPtrOff + 8)
  389.         DEF SEG
  390.  
  391.  
  392.                                                                                6
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.      ExitMidi            Func: 2        Pack: XitMidiPack
  404.  
  405.  
  406.      After having initialized a device via InitMidi, you must call ExitMidi
  407.      before initializing a new device or before your program ends. ExitMidi
  408.      performs three tasks. It frees any memory directly allocated by RUCKUS-MIDI
  409.      (such as within LoadMidi), it shuts down the device last initialized, and
  410.      it restores any hooked interrupts.
  411.  
  412.      This function should be called before ending your program. If your
  413.      development system supports the ANSI _atexit, it will be called
  414.      automatically (see AtExitMidi below).
  415.  
  416.      Sample Use:
  417.  
  418.      DIM XMP AS XitMidiPackTYPE
  419.  
  420.      'program has run its course, before exiting to DOS perform cleanup
  421.  
  422.      XMP.Func = ExitMidi
  423.      stat = RUCKMIDI(XMP)
  424.      END 
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.                                                                                7
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.      AtExitMidi          Func: 3        Pack: XitMidiPack
  470.  
  471.  
  472.      AtExitMidi is used to register the MidiExit routine to be called as a
  473.      normal procedure in the ending of your program. It will be called by the
  474.      compiler's startup code after your program _main() has ended. This is
  475.      important since it ensures that all resources allocated by RUCKUS-MIDI are
  476.      freed and that the sound device is properly shut down.
  477.  
  478.      AtExitMidi should be called immediately after initializing your first
  479.      device. It need not (and should not) be called again during the program. In
  480.      other words, you can InitMidi/ExitMidi as many times during a program's
  481.      execution as you want, but you should only call AtExitMidi after the first
  482.      InitMidi.
  483.  
  484.      It is possible for _atexit to fail to register ExitMidi. This would be the
  485.      result of too many registrations requests having been made to _atexit.
  486.      Since _atexit typically can handle 32 registrations, it is unlikely to fail
  487.      (fail=become full). If it does fail, it should _not_ be considered a fatal
  488.      error, however, be aware that the automatic ExitMidi call will not take
  489.      place.
  490.  
  491.      Sample Use:
  492.  
  493.      DIM MIMP AS mInitMidiPack
  494.      DIM XMP AS XitMidiPack
  495.      DIM CalledBefore AS INTEGER   'use STATIC CalledBefore... in SUB/FUNC
  496.  
  497.      MIMP.Func = InitMidi
  498.      MIMP.DeviceID = 1
  499.      MIMP.IOport = &H388
  500.      MIMP.PercCh = 9
  501.      MIMP.ChMask = &H23F
  502.      MIMP.Flags = 0          
  503.      stat = RUCKMIDI(MIMP)
  504.      IF stat = 0 THEN
  505.  
  506.         'check to make sure that this is the first AtExitMidi call
  507.  
  508.         IF CalledBefore = 0 THEN
  509.            XMP.Func = AtExitMidi
  510.            stat = RUCKMIDI(XMP)
  511.  
  512.            IF stat = 0 THEN 
  513.               CalledBefore = -1
  514.            ELSE
  515.               PRINT "_atexit unable to register ExitMidi"
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                                                                                8
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.      LoadMidi            Func: 4        Pack: LoadMidiPack
  536.  
  537.  
  538.      Use to load MIDI data into DOS memory. While you may use your own memory
  539.      allocation and DOS file routines to load MIDI data, LoadMidi automates this
  540.      task.
  541.  
  542.      LoadMidi makes memory allocations directly from the operating system pool*.
  543.      This means that before using LoadMidi DOS must have enough available memory
  544.      to into which to load the file. For QuickBASIC (QuickBASIC, BASIC7, and
  545.      VBDOS) you can use SETMEM(). For most other compilers, memory is not
  546.      allocated until it's needed, thus DOS will be in control of any unallocated
  547.      memory which is just the way LoadMidi likes it.
  548.  
  549.           Note: In Borland C compilers, memory allocations made via DOS INT21/48
  550.           cannot be used when any _malloc() call is made. Doing so corrupts the
  551.           _malloc() chain. This is strictly a Borland problem. To overcome this
  552.           limitation, you must use the memory module patch, MIDMEMBC.OBJ. See
  553.           the C-specific version of RUCKUS for more on this patch.
  554.  
  555.      LoadMidi manages up to 32 files in memory at one time, given sufficient
  556.      RAM. LoadMidi can also seek into a given file at any position and start
  557.      loading from that position for any number of bytes. This lets you
  558.      concatenate several MIDI data files into one and load any or all of the
  559.      internal MIDI data streams into memory. In addition, you can load the
  560.      entire file into memory and, by using pre-calculated memory offsets, start
  561.      MidiPlay at any of the MIDI data streams. 
  562.  
  563.      LoadMidi performs no format checking. Format checking is done by MidiPlay.
  564.  
  565.      Once a file has been loaded by LoadMidi, you can release the memory used by
  566.      the file by using DeallocMidi. See that routine for more.
  567.  
  568.      Sample Use:
  569.  
  570.      DIM LMP AS LoadMidiPackTYPE  'for multiple concurrent loads 
  571.                                   'use LMP(1 TO NumOfLoads) AS...
  572.  
  573.      filename$ = file2load$ + CHR$(0) 'filename must end with ASCII 0
  574.  
  575.      LMP.Func = LoadMidi
  576.      LMP.FilenamePtrOff = SADD(filename$)    'VARSEG() is QuickBASIC format
  577.      LMP.FilenamePtrSeg = VARSEG(filename$)  'BASIC7/VBDOS use SSEG(filename$)
  578.      LMP.StartPos = 0&     'start load at first byte of file
  579.      LMP.LoadSize = 0&     'when=0 entire file is loaded into memory
  580.      stat = RUCKMIDI(LMP)
  581.      IF stat = 0 THEN
  582.         'LMP.LoadPtrOff/Seg is address of load and used by MidiPlay
  583.         'LMP.LoadPtrOff is always returned=0
  584.         'LMP.LoadPtrSeg is DOS segment allocated
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                                                                                9
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.      PlayMidi            Func: 5        Pack: PlaybackMidiPack
  602.  
  603.  
  604.      Once MIDI data is in memory, you can begin play. Play is done as a
  605.      background task allowing other operations, such as screen updating or file
  606.      loading, to continue. Once you begin play, it plays itself. You need only
  607.      check the end of play status to determine when a MIDI stream has completed
  608.      play. All other aspects of MIDI play is handled by RUCKUS-MIDI.
  609.  
  610.      A routine also available in RUCKUS-MIDI is OutMsgMidi. You can use
  611.      OutMsgMidi to issue MIDI channel messages directly. 
  612.  
  613.      File format type is checked by PlayMidi. To determine file format before
  614.      actual play see FastFwdMidi. Note that ROL-converted MIDI files (via
  615.      ROL2MIDI.EXE) and CMF files can only be played (correctly) when using the
  616.      OPL-2 or -3 chip (on AdLib-compatibles such as SB, PAS, SB Pro, etc.).
  617.  
  618.      Sample Use:
  619.  
  620.      DIM PBMP AS PlaybackMidiPackTYPE  'LMP and DMP assumed defined
  621.  
  622.      PBMP.Func = PlayMidi
  623.      PBMP.Mode = 1          'this must be 1 for background play
  624.  
  625.      PBMP.LoadPtrOff = LMP.LoadPtrOff   'LoadPtr as set by LoadMidi
  626.      PBMP.LoadPtrSeg = LMP.LoadPtrSeg
  627.      stat = RUCKMIDI(PBMP)
  628.      IF stat = 0 THEN
  629.         
  630.         'the MIDI data is being played in the background
  631.         'at this point you can do anything you want
  632.         'for this example we just wait for the end status to become true
  633.         'see Appendix D. for information on the RUCKUS-MIDI data area
  634.  
  635.         DEF SEG = MIMP.InfoPtrSeg     'as set by InitMidi
  636.         midend = MIMP.InfoPtrOff + 6  'offset to mid@end in data area
  637.  
  638.         DO
  639.            DonePlaying = PEEK(midend) '=0 until MIDI data has ended
  640.                                       'and non-zero when data has ended
  641.         LOOP UNTIL DonePlaying
  642.         DEF SEG
  643.  
  644.         XMP.Func = EndMidi            'EndMidi should be called whenever
  645.         stat = RUCKMIDI(XMP)          'a MIDI tune is has ended
  646.  
  647.         'if no further use for this MIDI data, release the memory it uses
  648.         'see DeallocMidi for more information
  649.  
  650.         DMP.Func = DeallocMidi
  651.         DMP.HandSeg = LMP.LoadPtrSeg
  652.         DMP.TypeFlag = 0
  653.         stat = RUCKMIDI(DMP)
  654.  
  655.  
  656.                                                                               10
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.      EndMidi             Func: 8        Pack: XitMidiPack
  668.  
  669.  
  670.      Use to stop play of the initialized device. EndMidi is similar in function
  671.      to ExitMidi except that it does not release any memory. It does not
  672.      completely shut down the initialized device but it does restore hooked
  673.      interrupts.
  674.  
  675.      EndMidi can be thought of as a stop button, whereas ExitMidi is more like
  676.      the on/off switch.
  677.  
  678.      Sample Use:
  679.  
  680.      DIM XMP AS XitMidiPackTYPE
  681.  
  682.      'MIDI tune has play and is over, perform EndMidi to restore hooked
  683.      'interrupts and silence device
  684.  
  685.      XMP.Func = EndMidi
  686.      stat = RUCKMIDI(XMP)
  687.  
  688.      'now continue with program such as load next tune, play, etc.
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.                                                                               11
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.      PauseMidi           Func: 9        Pack: PauseMidiPack
  734.  
  735.  
  736.      Use to pause or unpause currently playing MIDI data. There is no effect if
  737.      no data is currently playing.
  738.  
  739.      Sample Use:
  740.  
  741.      DIM PMP AS PauseMidiPack
  742.  
  743.      'pause or unpause depending on state of DoPause flag
  744.  
  745.      IF DoPause THEN
  746.         PMP.Pause = 1 
  747.      ELSE
  748.         PMP.Pause = 0
  749.      ENDIF
  750.  
  751.      PMP.Func = PauseMidi
  752.      stat = RUCKMIDI(PMP)
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.                                                                               12
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.      DeallocMidi         Func: 10       Pack: DeallocMidiPack
  800.  
  801.  
  802.      Use to release memory used by LoadMidi. Once a file has been loaded via
  803.      LoadMidi, the memory used by that load is not available for other loads
  804.      until you release it using DeallocMidi. 
  805.  
  806.      If you will only be needing one MIDI data stream in memory at a time you
  807.      can load as many files as you want using only the memory needed by the
  808.      largest file loaded (i.e., reuse the memory). For example, let's say that
  809.      you have 40 separate MIDI data files that you will be playing. A simple
  810.      method to load these is to free up 64K (single MIDI file max for RUCKUS-
  811.      MIDI), LoadMidi a MIDI file, play it through, DeallocMidi the memory it
  812.      used, LoadMidi the next MIDI file, play it through, DeallocMidi, and so on.
  813.      This technique can also be used to LoadMidi into one concatenated file.
  814.      This requires that you pre-calculate at what offset each MIDI data stream
  815.      starts and its size. 
  816.  
  817.      DeallocMidi is called automatically by ExitMidi.
  818.  
  819.      Sample Use:
  820.  
  821.      DIM DMP AS DeallocMidiPackTYPE
  822.  
  823.      DMP.Func = DeallocMidi
  824.      DMP.HandSeg = LMP.LoadPtrSeg    'as set by LoadMidi
  825.      DMP.TypeFlag = 0                'must be = 0
  826.      stat = RUCKMIDI(DMP)
  827.      IF stat = 9 THEN 
  828.         PRINT "Invalid LMP.LoadPtrSeg, Not a fatal error"
  829.         'means that LMP.LoadPtrSeg is not valid
  830.         'perhaps it's already been deallocated by ExitMidi
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                                                                               13
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.      FastFwdMidi         Func: 11       Pack: FastFwdMidiPack
  866.  
  867.  
  868.      A standard MIDI file is a series of MIDI messages that are sequenced by
  869.      based on timings within the file. Each MIDI message is preceded by a tick
  870.      count that informs MIDI-RUCKUS when to output each particular message.
  871.  
  872.      FastFwdMidi instructs RUCKUS-MIDI to disregard all timing information up to
  873.      the specified tick count. It also mutes the output so no sound is produced.
  874.      The actual fast forward does not take place until the PlayMidi function is
  875.      called. After using FastFwdMidi, you must call FastFwdMidi again with
  876.      FFMP.TickCount=0& to turn off fast-forward mode.
  877.  
  878.      One use of FastFwdMidi is determine the running time of a MIDI file.
  879.  
  880.      Sample Use:
  881.  
  882.      DIM FFMP AS FastFwdMidiPack
  883.  
  884.      FFMP.Func = FastFwdMidi      'Given the MIDI data is already in memory...
  885.      FFMP.TickCount = -1&         'set to fast-fwd all the way through
  886.      stat = RUCKMIDI(FFMP)
  887.      IF stat = 0 THEN
  888.         PBMP.Func = PlayMidi      'play but in fast fwd mode
  889.         PBMP.Mode = 1
  890.         PBMP.LoadPtrOff = LMP.LoadPtrOff
  891.         PBMP.LoadPtrSeg = LMP.LoadPtrSeg
  892.         stat = RUCKMIDI(PBMP)
  893.         IF stat = 0 THEN
  894.  
  895.            DEF SEG = MIMP.InfoPtrSeg
  896.            bp = MIMP.InfoPtrOff          'bp used to lessen line length
  897.            DO : LOOP UNTIL PEEK(bp + 6)  'wait to end
  898.            
  899.            'TotalTicks& is the tick count at the end the last MIDI message
  900.            '--also need Ticks/quarternote and microseconds/quarternote
  901.  
  902.            TotalTicks& = PEEKD(bp + 22)  'see Appendix A. for PEEKD(),PEEKW()
  903.            TicksQnote = PEEKW(bp + 16)   
  904.            uSecsQnote& = PEEKD(bp + 18)  'watch for overflow so div\10 below!
  905.            DEF SEG
  906.  
  907.            TimeInSecs = ((uSecsQnote&\10)*(TotalTicks&\TicksQnote))\100000
  908.  
  909.            FFMP.Func = FastFwdMidi
  910.            FFMP.TickCount = 0&          'set FastFwdMidi off
  911.            stat = RUCKMIDI(FFMP)
  912.  
  913.      To fast forward in small increments while the MIDI data is playing, first
  914.      get the current TickCount (at bp+22), add to it the number of ticks to
  915.      skip, and use that as the FFMP.TickCount. If FFMP.TickCount > TotalTicks&
  916.      then do not perform the fast forward since it would be past the end of
  917.      data. See Appendix A. for an source example of this.
  918.  
  919.  
  920.                                                                               14
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.      OutMsgMidi          Func: 12       Pack: OutMsgMidiPack
  932.  
  933.  
  934.      OutMsgMidi lets you send MIDI channel messages directly to the channel
  935.      message parser without needing to use PlayMidi. Whereas PlayMidi deals with
  936.      all aspects of playing a MIDI stream, such as interrupt setup, timing
  937.      control and other events required to process the MIDI data, OutMsgMidi
  938.      provides access to only the channel message parser of RUCKUS-MIDI.
  939.  
  940.      MIDI channel messages (composed of channel voice and mode messages) are
  941.      those that control the actual sound output. The current MIDI 1.0
  942.      specification specifies eight message groups, each identified by a status
  943.      byte and followed by one or two data bytes. See Appendix E. for more
  944.      information on MIDI channel messages, key numbers and frequencies.
  945.  
  946.      Obvious use of OutMsgMidi is for sound effects. Notes can be sounded,
  947.      volumes adjusted, programs (instruments) selected and fine-tuned, and sound
  948.      can be turned off.
  949.  
  950.      When outputting to a channel be aware that NoteOn messages will not sound
  951.      if the channel is already in a NoteOn. I.e., each NoteOn should have a
  952.      corresponding NoteOff (or NoteOn with velocity=0).
  953.  
  954.      Sample Use:
  955.  
  956.      DIM OMMP AS OutMsgMidiPackTYPE
  957.  
  958.      OMMP.Func = OutMsgMidi
  959.      OMMP.Mstatus = &H80       'channel 0, NoteOn
  960.      OMMP.Mdata = &H7F3C       'sound middle-C (3Fh=60d) at max vol (7Fh=127d)
  961.      stat = RUCKMIDI(OMMP)
  962.  
  963.      'for those unfamiliar with hex notation, you can use the following to 
  964.      'derive Mdata values:
  965.      '
  966.      'Mdata = (Volume * 256) + NoteNumber
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.                                                                               15
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.      SetAllMidi          Func: 20       Pack: SetMidiPack
  998.  
  999.  
  1000.      While MIDI editing is best done on the MIDI data file itself with a
  1001.      sequencer/editor, RUCKUS-MIDI provides relative volume and tone adjustment
  1002.      to the MIDI data stream. Also, you may select the MIDI program/patch map to
  1003.      use. The channel mask as set in InitMidi may also be adjusted. You may also
  1004.      call each of these routines separately (see following SetMidi routines).
  1005.      For information on setting the patch map, set SetPatchMidi.
  1006.  
  1007.      The relative volume and tone adjustments let you boost or cut the playback
  1008.      levels of any or all of the MIDI channels (0-15). For example, if the MIDI
  1009.      data file has a trumpet playing to low on channel 4, you can boost channel
  1010.      4's relative volume so that the trumpet plays louder. Volume adjustment
  1011.      takes effect immediately.
  1012.  
  1013.      Tone adjustment allows you to adjust the notes being sounded in any or all
  1014.      of the channels. For example, if you want to have the notes sound on
  1015.      channel 5 play an octave lower, you adjust channel 5's relative tone by -
  1016.      12. Two octaves lower adjust by -24; an octave higher, adjust by +12; so
  1017.      on. Tone adjustment takes effect on the next sounded note.
  1018.  
  1019.      For adjusting relative levels you must designate which channels to operate
  1020.      on. SMP.Channel is a bit-mapped mask used to identify which channels. Each
  1021.      MIDI channel (0-15) has a corresponding bit in SMP.Channel. Channel 0 has
  1022.      SMP.Channel bit 0 as its mask; channel 1, bit 1; so on. For example, for
  1023.      this call to affect only channel 0, set SMP.Channel = 1. For only MIDI
  1024.      channel 1, use 2. For both channels 0 and 1, use 3. For those unfamiliar
  1025.      with binary notation, the following formula can be used.
  1026.  
  1027.      'Given the array BM(0 TO 15) is non-zero for each channel to be adjusted:
  1028.      '(Note: Since accum may overflow we process bit 15 as a special case)
  1029.      accum = 0
  1030.      FOR i = 0 TO 14
  1031.         IF BM(i) THEN accum = accum + (2 ^ i)
  1032.      NEXT
  1033.      IF BM(15) THEN accum = accum OR &H8000  'use this as SMP.Channel
  1034.  
  1035.      Sample Use:
  1036.  
  1037.      DIM SMP AS SetMidiPackTYPE
  1038.  
  1039.      SMP.Func = SetAllMidi
  1040.      SMP.Channel = &H21       'adjust channels 0 and 5 only
  1041.      SMP.Channel = 13         'increase those channels' volumes by 13
  1042.      SMP.Tone = 0             'no adjustments for tone
  1043.      SMP.ChMask = MIMP.ChMask 'use same channels as at InitMidi
  1044.      SMP.PatchMapID = 1       'use internal MT-32 program map
  1045.      SMP.PatchMapPtrOff = 0   'since using internal map these should be=0
  1046.      SMP.PatchMapPtrSeg = 0   '(see SetPatchMidi for more on PatchMapID)
  1047.      stat = RUCKMIDI(SMP)     
  1048.      IF stat = 0 THEN 'okay
  1049.  
  1050.  
  1051.  
  1052.                                                                               16
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.      SetVolumeMidi       Func: 21       Pack: SetMidiPack
  1064.  
  1065.  
  1066.      The relative volume adjustment lets you boost or cut the playback volume
  1067.      level of any or all of the MIDI channels (0-15). For example, if the MIDI
  1068.      data file has a trumpet playing to low on channel 4, you can boost channel
  1069.      4's relative volume so that the trumpet plays louder. Volume adjustment
  1070.      takes effect immediately. Any relative increase in volume level will not
  1071.      exceed the maximum level allowed, i.e., if the trumpet is already playing
  1072.      at its maximum volume, any positive relative adjustment will have no
  1073.      effect.
  1074.  
  1075.      For adjusting relative volume you must designate which channels to operate
  1076.      on. SMP.Channel is a bit-mapped mask used to identify which channels. Each
  1077.      MIDI channel (0-15) has a corresponding bit in SMP.Channel. See SetAllMidi
  1078.      on how to do this.
  1079.  
  1080.      Level adjustment range is -128 to 127.
  1081.  
  1082.      Sample Use:
  1083.  
  1084.      DIM SMP AS SetMidiPackTYPE
  1085.  
  1086.      SMP.Func = SetVolumeMidi
  1087.      SMP.Channel = &H31       'adjust channels 0, 4 and 5 only
  1088.      SMP.Volume = 127         'play those channels always at max volume
  1089.      stat = RUCKMIDI(SMP)     
  1090.      IF stat = 0 THEN 'okay
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.                                                                               17
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.      SetToneMidi         Func: 22       Pack: SetMidiPack
  1130.  
  1131.  
  1132.      Tone adjustment allows you to adjust notes being sounded in any or all of
  1133.      the channels. For example, if you want to have the notes sound on channel 5
  1134.      play an octave lower, adjust channel 5's relative tone by -12. Two octaves
  1135.      lower adjust by -24; an octave higher, adjust by +12; so on. Tone
  1136.      adjustment takes effect on the next sounded note. For more on note numbers
  1137.      and their relationship to notes and octaves, see Appendix E. 
  1138.  
  1139.      For adjusting relative tone you must designate which channels to operate
  1140.      on. SMP.Channel is a bit-mapped mask used to identify which channels. Each
  1141.      MIDI channel (0-15) has a corresponding bit in SMP.Channel. See SetAllMidi
  1142.      on how to do this.
  1143.  
  1144.      Level adjustment range is -128 to 127.
  1145.  
  1146.      Sample Use:
  1147.  
  1148.      DIM SMP AS SetMidiPackTYPE
  1149.  
  1150.      SMP.Func = SetToneMidi
  1151.      SMP.Channel = &H1        'adjust channel 0 only
  1152.      SMP.Tone = -12           'play notes on that channel one octave lower    
  1153.      stat = RUCKMIDI(SMP)     
  1154.      IF stat = 0 THEN 'okay
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.                                                                               18
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.      SetPatchMidi        Func: 23       Pack: SetMidiPack
  1196.  
  1197.  
  1198.      MIDI specifies instruments by number (0-127). These instruments are often
  1199.      called programs, or patches. The one big incompatibility among MIDI data
  1200.      files is correspondence of instrument number to instrument sound. Up to
  1201.      just a few years ago, there was no standard, so that files made by one
  1202.      sequencer often sounded totally wrong when played on another. Ideally,
  1203.      there would be only one program map that all MIDI used, but that would be
  1204.      to restrictive to musicians. Because of this lack of standard, the
  1205.      International MIDI Association (IMA) created what is know as the General
  1206.      MIDI Sound Set. This is a standardized set of programs that map instrument
  1207.      numbers to known instrument sounds. It also standardizes the percussion
  1208.      map. 
  1209.  
  1210.      The percussion map is similar to the main sound set but is used to sound a
  1211.      wide range of percussive instruments (the main sound set is nearly all
  1212.      melodic instruments). The percussion map takes note numbers that are output
  1213.      on a certain channel (channel 9 by standard (0-based)) and maps that note
  1214.      number to a particular percussive sound. For example, note 60 when played
  1215.      on any channel but the percussion channel plays a middle-C on whatever the
  1216.      current instrument program is for that channel. However, when note number
  1217.      60 is played on the percussion channel, it maps to the Hi Bongo. Note
  1218.      number 35 maps to the bass drum. See Appendix F. for the General MIDI Sound
  1219.      Set description.
  1220.  
  1221.      In addition to the General MIDI (GM) set, RUCKUS-MIDI also maps to the MT-
  1222.      32 sound set. Many MIDI files have been sequenced to the MT-32 set (see
  1223.      Appendix G. for the MT-32 sound set). In the future, you'll find more and
  1224.      more files sequenced to General MIDI. Microsoft Windows Multimedia
  1225.      specifies General MIDI as its sound set. RUCKUS-MIDI uses the GM map by
  1226.      default.
  1227.  
  1228.      For those MIDI files that do not comply with either GM or MT-32, RUCKUS-
  1229.      MIDI allows for custom patch maps to be used. See Appendix H. for custom
  1230.      patch map specifications and implementation notes. Be aware, however, that
  1231.      custom patch maps (those created by you) are device dependent. This means
  1232.      that you need a separate custom patch map for each device you intend to
  1233.      support. The internal RUCKUS-MIDI patch maps will always be device-
  1234.      independent, in that all current and future devices supported by RUCKUS-
  1235.      MIDI will have a GM and an MT-32 map available.
  1236.  
  1237.      Sample Use:
  1238.  
  1239.      DIM SMP AS SetMidiPackTYPE
  1240.  
  1241.      SMP.Func = SetPatchMidi
  1242.      SMP.PatchMapID = 1       '1=MT-32 (0=GM and -1 means use custom map)
  1243.      SMP.PatchMapPtrOff = 0
  1244.      SMP.PatchMapPtrSeg = 0   'since not using custom patch, set these=0
  1245.      stat = RUCKMIDI(SMP)
  1246.      IF stat = 0 THEN 'okay
  1247.  
  1248.  
  1249.  
  1250.                                                                               19
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.      SetChMaskMidi       Func: 24       Pack: SetMidiPack
  1262.  
  1263.  
  1264.      SetChMaskMidi adjusts the same channel mask as that specified for InitMidi.
  1265.  
  1266.      There are 16 MIDI channels, numbered 0 to 15 in RUCKUS-MIDI (sometimes seen
  1267.      numbered 1-16). Each channel can be used to play a particular program, or
  1268.      instrument (sometimes called a voice). For example, say a MIDI file playing
  1269.      "Street Fight" is sequenced for piano and guitar. Each instrument could be
  1270.      played at the same time providing that there is a channel available for
  1271.      each. Since there are only 2 instruments and 16 MIDI channels, that's no
  1272.      problem. Further, let's say that, later, you don't want to hear the piano
  1273.      voice. By using SetChMaskMidi, you can selectively turn off the piano
  1274.      channel (channel 0, or whichever channel it's on). 
  1275.  
  1276.      SetChMaskMidi also has another important use. It can be used to turn off
  1277.      channels that are not supported by the currently selected device. For
  1278.      example, the AdLib MSC in percussive mode (RUCKUS-MIDI deviceID 1) does not
  1279.      support channels 6 to 8, and 10 to 15. These channels are not supported
  1280.      because there are not sufficient voices available on that device. These
  1281.      channels (6-8, 10-15) should be masked out so that they are not processed.
  1282.  
  1283.      In addition to turning off channels that cannot be supported due to lack of
  1284.      voices, it may also be necessary to turn off MIDI channels due to the way
  1285.      the MIDI file has been sequenced. In particular, Microsoft Windows
  1286.      Multimedia Specification dictates that MIDI files be sequenced redundantly.
  1287.      Channels 0 to 9 are for so-called extended synthesizers, and channels 12 to
  1288.      15 are for so-called base-level synthesizers. In either case, the highest
  1289.      channel (9 and 15, respectively) is used for the percussive channel. The
  1290.      specification also states that the most important channels be the lower-
  1291.      numbered (respective their synthesizer level). In RUCKUS-MIDI, such
  1292.      redundant MIDI files should always be played as if an extended synthesizer
  1293.      is active (channels 0 to 9) and the base-level redundant channels (12 to
  1294.      15, as well as channels 10 and 11) should be masked out.
  1295.  
  1296.      SMP.ChMask is a bitmapped mask, 1 bit for each channel. See SetAllMidi for
  1297.      an example in how to determine the value to use for SMP.ChMask.
  1298.  
  1299.      Sample Use:
  1300.  
  1301.      DIM SMP AS SetMidiPackTYPE
  1302.  
  1303.      SMP.Func = SetChMaskMidi
  1304.      SMP.ChMask = 3            'turn off all channels except 0 and 1
  1305.      stat = RUCKMIDI(SMP)
  1306.      IF stat = 0 THEN 'okay
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.                                                                               20
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.      SetAllFMSBP         Func:30        Pack: SetFMProPack
  1328.  
  1329.  
  1330.      Though RUCKUS-MIDI is intended and is designed to be device independent,
  1331.      there will be need for access to device-dependant features. The Sound
  1332.      Blaster Pro, for example, has an on-board mixer facility that controls FM
  1333.      chip volume. By default, the SB Pro is set to half-volume, much too low for
  1334.      typical use. By using SetAllFMSBP you can set the FM volume to maximum and
  1335.      let the actual sound volume be controlled via the MIDI data itself.
  1336.  
  1337.      In addition to the basic volume settings, you can also adjust the steering.
  1338.      Steering turns off either the left, right, or both channels. On late-model
  1339.      SB Pro cards, the independent left and right FM channel volumes can be used
  1340.      for better effect (smoother panning). Early-model SB Pros may not have the
  1341.      independent left/right volume adjustments and so steering is used to shift
  1342.      (all) sound left or right. The steering can also be set to mute the FM
  1343.      output. You may find that muting the SB Pro before InitMidi and before
  1344.      EndMidi results in a smoother sound and song transition.
  1345.  
  1346.      There is no Sound Blaster Pro detection routine available in RUCKUS-MIDI
  1347.      since the only device currently supported is the basic FM chip, originally
  1348.      used by the AdLib MSC (which is what the Sound Blaster and other
  1349.      compatibles use). Any device supporting the AdLib at I/O port 388h is
  1350.      detected. When OPL-3 (a super-set of the AdLib chip used by the SB Pro and
  1351.      others) support is added, additional detection routines for it will be
  1352.      included. Using SetAllFMSBP with no SB Pro installed should not present any
  1353.      problems, however, for absolute determination of an SB Pro device, use the
  1354.      detection routines in RUCKUS-DAC.
  1355.  
  1356.      The SB Pro base address I/O port is currently selectable at either 220h
  1357.      (the SB Pro default) or at 240h. Use RUCKUS-DAC for absolute determination.
  1358.      The master volume adjusts the Pro's master volume (also adjustable in
  1359.      RUCKUS-DAC). To low byte of SFMPP.MastVol sets the left channel's volume.
  1360.      The high byte sets the right channel's. Range for each is 1 to 15, odd
  1361.      values only. To set the right channel, multiply the volume by 256, e.g.,
  1362.      SFMPP.MastVol = (256 * RtChVol) + LfChVol. To not change the master volume,
  1363.      set to -1. SFMPP.FMvol has the same range and is set the same way. It
  1364.      cannot be skipped. Steering, described above, can also be skipped by
  1365.      setting SFMPP.Steer to -1. It's practical use is to mute output during
  1366.      InitMidi and during an abrupt EndMidi (abrupt EndMidi meaning ending a
  1367.      MidiPlay before the actual end of data and notes may still be sounding).
  1368.  
  1369.      Sample Use:
  1370.  
  1371.      DIM SFMPP AS SetFMProPackTYPE
  1372.  
  1373.      SFMPP.Func = SetAllFMSBP
  1374.      SFMPP.IOport = &H220     'base port of SB Pro (220h or 240h)
  1375.      SFMPP.MasterVol = &HF0F  'low byte=left,high=right,-1=no change
  1376.      SFMPP.Steer = 0          '0=none,1=left,2=right,3=mute,-1=no change
  1377.      SFMPP.FMvol = &HF0F      'low byte=left,high=right (cannot skip)
  1378.      stat = RUCKMIDI(SFMPP)
  1379.      IF stat = 0 THEN 'okay
  1380.  
  1381.  
  1382.                                                                               21
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.      Appendix A. Tips and Tricks.
  1394.  
  1395.  
  1396.      1. PEEK() Word and Double-word Values from Memory.
  1397.      2. Noise Abatement.
  1398.  
  1399.  
  1400.      1. PEEK() Word and Double-word Values from Memory.
  1401.  
  1402.      BASIC provides for a simple, single-byte peek into memory. Since much of
  1403.      RUCKUS-MIDI data is word or double-word size, the following functions can
  1404.      be used:
  1405.  
  1406.      FUNCTION PEEKW%(Offset) STATIC
  1407.      tLow = PEEK(Offset)
  1408.      tHigh = PEEK(Offset + 1)
  1409.      t& = (256& * tHigh) + tLow
  1410.      IF t& > 32767 THEN
  1411.         PEEKW = t& - 65536
  1412.      ELSE
  1413.         PEEKW = t&
  1414.      ENDIF
  1415.      END FUNCTION
  1416.  
  1417.      FUNCTION PEEKD&(Offset) STATIC
  1418.      DIM S4 AS STRING * 4
  1419.      tB0 = PEEK(Offset)
  1420.      tB1 = PEEK(Offset + 1)
  1421.      tB2 = PEEK(Offset + 2)
  1422.      tB3 = PEEK(Offset + 3)
  1423.      S4 = CHR$(tB3) + CHR$(tB2) + CHR$(tB1) + CHR$(tB0)
  1424.      PEEKD& = CVL(S4)
  1425.      END FUNCTION
  1426.  
  1427.  
  1428.      2. Noise Abatement.
  1429.  
  1430.      If a Sound Blaster Pro is known to be available and is used as the MIDI
  1431.      device, noise can be minimized by setting the FM volume to 0, or by muting
  1432.      the FM steering. It can also be used when abruptly ending a MIDI playback
  1433.      before actual end of data. If no SB Pro is available, setting all MIDI
  1434.      relative volumes to -128 should reduce any spurious noise.
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.                                                                               22
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.      Appendix B. RUCKUS-MIDI Pack Structure.
  1460.  
  1461.  
  1462.      DECLARE FUNCTION RUCKMIDI% (SEG packinfo AS ANY)
  1463.  
  1464.      CONST SysInfoMidi = 0, InitMidi = 1, ExitMidi = 2, AtExitMidi = 3
  1465.      CONST LoadMidi = 4, PlayMidi = 5
  1466.      CONST EndMidi = 8, PauseMidi = 9
  1467.      CONST DeallocMidi = 10, FastFwdMidi = 11, OutMsgMidi = 12
  1468.  
  1469.      CONST SetAllMidi = 20, SetVolumeMidi = 21, SetToneMidi = 22
  1470.      CONST SetPatchMidi = 23, SetChMaskMidi = 24
  1471.  
  1472.      CONST SetAllFMSBP = 30
  1473.  
  1474.      TYPE DeallocMidiPackTYPE 'DMP
  1475.       Func       AS INTEGER
  1476.       stat       AS INTEGER
  1477.       HandSeg    AS INTEGER 'RUCKUS allocates DOS segment (para)
  1478.       TypeFlag   AS INTEGER '0=DOS para (must=0)
  1479.      END TYPE '8
  1480.  
  1481.      TYPE FastFwdMidiPackTYPE 'FFMP
  1482.       Func       AS INTEGER
  1483.       stat       AS INTEGER
  1484.       TickCount  AS LONG    'tick count to fast forward to
  1485.      end type '8
  1486.  
  1487.      TYPE GetMidiDataPackTYPE 'GDP
  1488.       Func       AS INTEGER
  1489.       stat       AS INTEGER
  1490.       BytePos    AS LONG    'current byte relative base ptr (27)
  1491.      END TYPE '8
  1492.  
  1493.      TYPE mInitMidiPackTYPE  'MIMP (can't use IMP with BASIC)
  1494.       Func       AS INTEGER
  1495.       stat       AS INTEGER
  1496.       DeviceID   AS INTEGER '0=AdLib melodic, 1=AdLib percussive
  1497.       IOport     AS INTEGER
  1498.       PercCh     AS INTEGER
  1499.       ChMask     AS INTEGER
  1500.       Flags      AS INTEGER '(see below)
  1501.       InfoPtrOff AS INTEGER 'ret:far ptr to Midi info
  1502.       InfoPtrSeg AS INTEGER
  1503.       MidiExitPtrOff AS INTEGER 'ret:far ptr to Midi's ExitXB routine
  1504.       MidiExitPtrSeg AS INTEGER
  1505.      END TYPE '22
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.                                                                               23
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.      TYPE LoadMidiPackTYPE   'LMP
  1527.       Func       AS INTEGER
  1528.       stat       AS INTEGER
  1529.       FilenamePtrOff AS INTEGER 'far ptr to filenameZ to load
  1530.       FilenamePtrSeg AS INTEGER
  1531.       StartPos   AS LONG     'offset into file to start load at
  1532.       LoadSize   AS LONG     'number of bytes to load (or 0 for autosize)
  1533.       LoadPtrOff AS INTEGER  'ret:DOS seg:offset (offset always 0)
  1534.       LoadPtrSeg AS INTEGER
  1535.      END TYPE '20
  1536.  
  1537.      TYPE OutMsgMidiPackTYPE 'OMMP
  1538.       Func       AS INTEGER
  1539.       stat       AS INTEGER
  1540.       Mstatus    AS INTEGER  'status byte (8n, 9n...)
  1541.       Mdata      AS INTEGER  'data (one or two bytes)
  1542.      END TYPE '8
  1543.  
  1544.      TYPE PlaybackMidiPackTYPE 'PMBP
  1545.       Func       AS INTEGER
  1546.       stat       AS INTEGER
  1547.       Mode       AS INTEGER  'playback mode (0=interrupt FG,1=BG)
  1548.       LoadPtrOff AS INTEGER  'seg:off to start of data to play
  1549.       LoadPtrSeg AS INTEGER
  1550.      END TYPE '10
  1551.  
  1552.      TYPE PauseMidiPackTYPE  'PMP
  1553.       Func       AS INTEGER
  1554.       stat       AS INTEGER
  1555.       Pause      AS INTEGER  '0=unpause else pause
  1556.      END TYPE '6
  1557.  
  1558.      TYPE SetFMProPackTYPE   'SFMPP (FM mixer control for SB PRO-compatibles)
  1559.       Func       AS INTEGER
  1560.       stat       AS INTEGER
  1561.       IOport     AS INTEGER  'base I/O port (&H220, &H240)
  1562.       MasterVol  AS INTEGER  '0F0F (low=right ch, high=left,-1 no change)
  1563.       Steer      AS INTEGER  '0=none,1=left,2=right,3=mute,-1 no change)
  1564.       FMVol      AS INTEGER  '0F0F (low=right,high=left,cannot skip)
  1565.      END TYPE '12
  1566.  
  1567.      TYPE SetMidiPackTYPE    'SMP
  1568.       Func       AS INTEGER
  1569.       stat       AS INTEGER
  1570.       Channel    AS INTEGER  'channel to set (bit mask of channels 0-15)
  1571.       Volume     AS INTEGER  'volume adjust
  1572.       Tone       AS INTEGER  'tone adjust
  1573.       ChMask     AS INTEGER  'if bit=0 then that channel is ignored
  1574.       PatchMapID AS INTEGER  'patch map ID
  1575.       PatchMapPtrOff AS INTEGER 'far ptr to alternate patch map or
  1576.       PatchMapPtrSeg AS INTEGER 'address of patch map ID selected
  1577.      END TYPE '18
  1578.  
  1579.  
  1580.                                                                               24
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.      TYPE SysInfoMidiPackTYPE 'SIMP
  1593.       Func       AS INTEGER  'this (or any) TYPE will be expanded as needed
  1594.       stat       AS INTEGER  'to accommodate additional MIDI devices
  1595.       Device0    AS INTEGER  '=1 AdLib melodic mode available
  1596.       D0port     AS INTEGER  '388h
  1597.       D0mask     AS INTEGER  '
  1598.       Device1    AS INTEGER  '=1 AdLib percussive mode available
  1599.       D1port     AS INTEGER  '388h
  1600.       D1mask     AS INTEGER  '(to be extended as new devices are added)
  1601.      END TYPE '16
  1602.  
  1603.      TYPE XitMidiPackTYPE    'XMP
  1604.       Func       AS INTEGER
  1605.       stat       AS INTEGER
  1606.      END TYPE '4
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.                                                                               25
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.      Appendix C. Compiler, Linker, QLB, and Call Use.
  1658.  
  1659.      Compile and Link.
  1660.  
  1661.      To create a stand-alone EXE file, compile your BASIC source as required. No
  1662.      special compiler switches are required. When your compiler is finished and
  1663.      has reported no errors during the compile, use the LINK program supplied
  1664.      with your compiler to resolve any external references in your BASIC program
  1665.      code that are dependent on the RUCKUS library code.
  1666.  
  1667.      For example, if you have a single-module BASIC source file called
  1668.      SOUND.BAS, compile it:
  1669.  
  1670.       C>bc SOUND /o;
  1671.  
  1672.      If successful, use the LINK program to build the final EXE:
  1673.  
  1674.       C>link SOUND,SOUND.EXE,nul,RUCKDAC.LIB RUCKMIDI.LIB;
  1675.  
  1676.      If successful, link creates SOUND.EXE ready to be run at the DOS prompt.
  1677.      The BASIC runtime is also supported by RUCKUS. Just compile as you normally
  1678.      would (without the /o, of course).
  1679.  
  1680.      RUCKUS is composed of many separate assembly language modules in two
  1681.      separate LIBs, one for digital data and the other for MIDI data.
  1682.  
  1683.      If you need to use more libraries with your programs, no problem, LINK can
  1684.      handle as many as you have. When LINK prompts you for a library file, just
  1685.      enter RUCKDAC.LIB and RUCKMIDI.LIB followed by any other library you need.
  1686.      For example:
  1687.  
  1688.       C>link
  1689.  
  1690.       Microsoft (R) Segmented Executable Linker  Version 5.31.009 Jul 13 1992
  1691.       Copyright (C) Microsoft Corp 1984-1992.  All rights reserved.
  1692.  
  1693.       Object Modules [.OBJ]: SOUND+STUB
  1694.       Run File [.EXE]: SOUND.EXE
  1695.       List File [NUL.MAP]: nul
  1696.       Libraries [.LIB]: RUCKDAC RUCKMIDI MOUSE;
  1697.  
  1698.      Consult your linker programs documentation for more.
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.                                                                               26
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.      Creating a QLB.
  1724.  
  1725.      If you use the QuickBASIC environment to program in, you need to build a
  1726.      .QLB so that you can call the RUCKUS routines. While QuickBASIC can load
  1727.      only a
  1728.      single QLB ( C>qb /L quicklib.qlb ), you can combine many LIB and OBJ
  1729.      modules to create the QLB. For example, to make a QLB of the RUCKDAC.LIB,
  1730.      RUCKMIDI.LIB and MOUSE.LIB libraries:
  1731.  
  1732.       C>link /QU RUCKDAC.LIB+RUCKMIDI.LIB+MOUSE.LIB, IDE.QLB, nul, BQLB45.LIB;
  1733.  
  1734.      Note the extension .LIB on the library modules. This is REQUIRED since LINK
  1735.      assumes .OBJ by default. The quick library, BQLB45.LIB, is required for the
  1736.      Libraries: prompt. The exact name depends on the compiler version. Consult
  1737.      your compiler documentation for more.
  1738.  
  1739.      BASIC PDS note: BASIC PDS requires that all BASIC modules included into a
  1740.      QLB be compiled using the /Fs compiler switch. This instructs the compiler
  1741.      to
  1742.      generate code compatible with "far strings". Since RUCKUS is written
  1743.      entirely in assembly language, this is not an issue. However, if you start
  1744.      QBX.EXE with /L and get an INVALID FORMAT error, one of the modules in the
  1745.      .QLB file most likely was a BASIC module that was not compiled with the /Fs
  1746.      switch.
  1747.  
  1748.  
  1749.      Calling RUCKDAC() and RUCKMIDI().
  1750.  
  1751.      RUCKUS is called through a single entry point. Depending on function
  1752.      (digital or MIDI) you use either RUCKDAC() or RUCKMIDI(). The only argument
  1753.      passed to is a segmented far pointer to the control pack. The first two
  1754.      entries in this pack are the function to be performed and the function
  1755.      return status. RUCKUS is a FUNCTION call returning an INTEGER status value
  1756.      (with a few exceptions, see the documentation).
  1757.  
  1758.      Each function (or routine) uses a prescribed pack format. For example, some
  1759.      routines need only know the function to perform. For example, to end a
  1760.      digital play you could do the following:
  1761.  
  1762.       DIM XP AS XitPackTYPE          'could also DIM SHARED
  1763.  
  1764.       XP.Func = EndDac               'EndDac is defined in RUCKDAC.BI
  1765.       stat = RUCKDAC(XP)             'do the actual call to RUCKUS-DAC
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.                                                                               27
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.      Appendix D. RUCKUS-MIDI Data Area.
  1790.  
  1791.  
  1792.      The offset value below is relative InfoPtrOff as returned by InitMidi. For
  1793.      example, to access mid@end, the following code can be used:
  1794.  
  1795.      DEF SEG = MIMP.InfoPtrSeg
  1796.      MidiIsOver = PEEK(MIMP.InfoPtrOff + 6)
  1797.      DEF SEG
  1798.  
  1799.      For accessing word (dw) and double-word (dd) values, see Appendix A. All
  1800.      mid@ variables are PUBLIC symbols and may be accessed directly by compilers
  1801.      that allow external references to variables. QuickBASIC does not so the DEF
  1802.      SEG method needs to be used. Where possible, access all mid@ data through a
  1803.      common function so that future changes can be easily made.
  1804.  
  1805.  
  1806.      Offset  Name         Type  Comments ----------------------------------
  1807.      +000 mid@deviceID     dw   0=AdLib melodic, 1=AdLib percussive...
  1808.         2 mid@flags        dw   bit0=1 reserved
  1809.                                 bit1=1 disable program change event
  1810.                                 bit2-7 reserved (Low byte used to send...
  1811.                                 ...while high byte used to return info)
  1812.                                 bit8-13 reserved
  1813.                                 bit14=1 then CTMF file playing
  1814.                                 bit15=1 then AdLib ROL-convert playing
  1815.         4 mid@percChannel  dw   <> 0 then percussion channel mapped
  1816.         6 mid@end          dw   =1 end of MIDI (not currently playing)
  1817.         8 mid@memDOS       dw   DOS RAM available in K
  1818.        10 mid@memUsed      dw   K used by last load
  1819.  
  1820.      The following data to mid@chNotes is zeroed before each initial play
  1821.      and is not valid until play has begun.
  1822.  
  1823.        12 mid@typeMIDI     dw   MIDI type (0 or 1)
  1824.        14 mid@noTracks     dw   number of tracks (1 to 64)
  1825.        16 mid@ticksQnote   dw   ticks/quarter-note
  1826.        18 mid@uSecsQnote   dd   micro-secs/quarter-note
  1827.        22 mid@tickCount    dd   current tick count
  1828.  
  1829.        26 mid@musicPtr     dd   seg:off->current MIDI data byte
  1830.        30 mid@currTrk      dw   current MIDI track (0 to noTracks-1)
  1831.        32 mid@timeSig pt1  DB   numerator        |Consult the MIDI 1.0|
  1832.        33 mid@timeSig pt2  DB   denominator      |specification on the|
  1833.        34 mid@timeSig pt3  DB   MIDI clocks/beat |implementation of   |
  1834.        35 mid@timeSig pt4  DB   32nd notes/beat  |the time signature  |
  1835.        36 mid@chPrograms   DB16 channel programs 0-15, 16 entries
  1836.        52 mid@chVolumes    DB16 channel volume levels (0-127), 16 entries
  1837.        68 mid@chNotes      DB16 channel note values (0-127), 16 entries
  1838.  
  1839.        84 mid@chRelVolumes dw16 -128 to 127 range (0=no change), 16 entries
  1840.       116 mid@chRelNotes   dw16 -128 to 127 range (0=no change), 16 entries
  1841.  
  1842.  
  1843.  
  1844.                                                                               28
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.      The following are device-dependent and so are not part of the formal
  1857.      RUCKUS-MIDI data area. They are provided in case you want to change the
  1858.      operation of RUCKUS-MIDI at its lowest level. They are PUBLIC symbols and
  1859.      can be accessed only by direct reference. For the actual internal patch
  1860.      maps used by RUCKUS-MIDI, refer to Appendix F & G.
  1861.  
  1862.           ad@PatchPtr      dd   far ptr to current programs, 0-127
  1863.           ad@PercMapPtr    dd   far ptr to current percussive map
  1864.  
  1865.      The following are the timbre data of DeviceID 1 percussive voices. All but
  1866.      bass drum, voice 6, use 1 operator. BD uses 2 operators. For the actual
  1867.      mappings used by RUCKUS-MIDI, refer to Appendix F & G.
  1868.  
  1869.      The first 13 bytes are for operator 0, the next 13 for operator 1, and the
  1870.      last 2 are wave shapes for operator 0 and 1, respectively. Format is:
  1871.  
  1872.      Op0: ksl,multi,fb(Op0),ar,sl,eg,dr,rr,tl,amvib,vib,ksr,c
  1873.      Op1: ksl,multi,fb(Op0),ar,sl,eg,dr,rr,tl,amvib,vib,ksr,c (BD only)
  1874.      Op0: wsm
  1875.      Op1: wsc
  1876.  
  1877.           ad@bdOps         DB 28 DUP (?)  Bass drum timbre
  1878.           ad@sdOp0         DB 28 DUP (?)  Snare drum timbre
  1879.           ad@tomOp0        DB 28 DUP (?)  Tom-tom timbre
  1880.           ad@cymOp0        DB 28 DUP (?)  Cymbal timbre
  1881.           ad@hhOp0         DB 28 DUP (?)  Hi-hat timbre
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.                                                                               29
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.      Appendix E. MIDI Key Numbers, Frequencies and Channel Messages.
  1922.  
  1923.  
  1924.       Octave  1      2       3       4       5       6      7      8
  1925.       Note                    (frequency in Hertz)
  1926.        C   16.352  32.704  65.40  130.81  261.63  523.26  1046.5 2093
  1927.        C#  17.324  34.648  69.29  138.59  277.18  554.36  1108.7 2217
  1928.        D   18.354  36.708  73.41  146.83  293.66  587.32  1174.6 2349
  1929.        D#  19.445  38.890  77.78  155.56  311.12  622.24  1244.4 2489
  1930.        E   20.601  41.202  82.40  164.80  329.61  659.23  1318.4 2637
  1931.        F   21.826  43.652  87.30  174.60  349.21  698.43  1396.8 2794
  1932.        F#  23.124  46.248  92.49  184.99  369.98  739.96  1479.9 2960
  1933.        G   24.499  48.998  97.99  195.99  391.98  783.96  1567.9 3136
  1934.        G#  25.956  51.912 103.82  207.64  415.29  830.59  1661.1 3322
  1935.        A   27.500  55.000 110.00  220.00  440.00  880.00  1760.0 3520
  1936.        A#  29.135  58.270 116.54  233.08  466.16  932.32  1864.6 3729
  1937.        B   30.867  61.734 123.46  246.93  493.87  987.74  1975.4 3951
  1938.  
  1939.      Note C1 (16Hz) is MIDI key number 12, C2 (32Hz) is 24...C5 (261Hz) is 60,
  1940.      middle-C on the piano keyboard. Valid key number range is 12 to 107 (96 key
  1941.      numbers total). This is peculiar to the OPL-2 chip. MIDI key number range
  1942.      is 0 to 127. Key numbers issued > 107 are set to 107 and numbers < 12 are
  1943.      set to 12 when using the OPL-2 or -3.
  1944.  
  1945.      For accessing steps between notes, you can use the PitchBend MIDI channel
  1946.      message (OutMsgMidi status byte En, Pitch Wheel Change). Each 512-point
  1947.      adjustment to pitchbend results in a 1-step change, giving a pitchbend
  1948.      range of +/- 16 steps per half-tone (pitchbend range is 0 to 16383 with
  1949.      8192 equal to no change).
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.                                                                               30
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.      MIDI channels messages are what OutMsgMidi transmits to the MIDI parser.
  1989.      For complete specifications on MIDI channel messages, MIDI system messages,
  1990.      and the other details of the inner-workings of MIDI, contact the
  1991.      International MIDI Association (IMA) and ask for the MIDI 1.0
  1992.      Specification. Several volumes are available for sale ranging from detailed
  1993.      specs to the standard MIDI file format. The IMA's mailing address is:
  1994.  
  1995.           IMA - the International MIDI Association
  1996.           5316 W 57 ST
  1997.           LOS ANGELES CA 90056
  1998.           USA
  1999.  
  2000.      The MIDI channel messages are:
  2001.  
  2002.      Message Name           Mstat/Mdata Comment
  2003.      -----------------------------------------------------------------
  2004.      Note Off                 8n kn v   kn=key number (0-127)
  2005.                                         v =velocity (0-127) (volume)
  2006.      Note On                  9n kn v   kn=key number (0-127)
  2007.                                         v =velocity (1-127,0=note off)
  2008.      Polyphonic After-Touch   An kn v   kn=key number (0-127)
  2009.                                         v =velocity (0-127)
  2010.      Control Change           Bn cn x   cn=controller (0-121, 0-79h)
  2011.                                         x =value (0-127)
  2012.                                         (Control Change not implemented)
  2013.      Channel Mode:
  2014.         All Notes Off         Bn 7B 0   7B=channel n sound off
  2015.                                         (Other modes not implemented)
  2016.      Program Change           Cn p      p =program (0-127)
  2017.      Channel After-Touch      Dn v      v =velocity (0-127)
  2018.      Pitch Wheel Change       En lb hb  lb=low byte (0-127)*
  2019.                                         hb=high byte (0-127)
  2020.  
  2021.      *All non-status bytes must have the high-order bit of each byte unset. For
  2022.      Pitch Wheel Change (En lb hb) where there is to be no change, lb/hb is to
  2023.      be set to 00/40h (4000h=8192, center pitch). The low byte's MSB should not
  2024.      be set, meaning that, for example, 4080 to 40FF are not valid pitch bends.
  2025.      If 4080h is used RUCKUS-MIDI unsets the MSB of lb so that 4000h is used.
  2026.  
  2027.      All status bytes have the high-order bit set. The n nybble of each status
  2028.      byte (e.g., 8n) designates the channel number, 0 to F (0 to 15d). Most MIDI
  2029.      channel messages takes two data bytes, though some take only one. The order
  2030.      shown above is the order that should be used. For example, to send the
  2031.      channel message NoteOn/key# 32/max volume via OutMsgMidi for channel 3, set
  2032.      Mstatus to 93h and set Mdata to &H7F20 (low/high bytes=20/7Fh).
  2033.  
  2034.      The specification is rather complex. RUCKUS-MIDI builds upon those aspects
  2035.      of the specification that are useful in playing back MIDI data. Much of the
  2036.      MIDI specification deals with real-time performance and recording use,
  2037.      neither of which is RUCKUS-MIDI's intended purpose.
  2038.  
  2039.  
  2040.  
  2041.  
  2042.                                                                               31
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.      Appendix F. General MIDI Sound Set - Level 1.
  2054.  
  2055.      Sound Set Program Number and Name.
  2056.  
  2057.      Prog#  Instrument        Prog#  Instrument       Prog#  Instrument
  2058.      ---------------------------------------------------------------------
  2059.       0 ACOUSTIC GRAND PIANO   43 CONTRABASS           86 LEAD 7 fifths
  2060.       1 BRITE ACOUSTIC PIANO   44 TREMELO STRINGS      87 LEAD 8 bass+lead
  2061.       2 ELECTRIC GRAND PIANO   45 PIZZICATO STRINGS    88 PAD 1 new age
  2062.       3 HONKEYTONK             46 ORCHESTRAL HARP      89 PAD 2 warm
  2063.       4 ELECTRIC PIANO 1       47 TIMPANI              90 PAD 3 polysynth
  2064.       5 ELECTRIC PIANO 2       48 STRING ENSEMBLE 1    91 PAD 4 choir
  2065.       6 HARPSICHORD            49 STRING ENSEMBLE 2    92 PAD 5 bowed
  2066.       7 CLAVI                  50 SYNTHSTRINGS 1       93 PAD 6 metallic
  2067.       8 CELESTA                51 SYNTHSTRINGS 2       94 PAD 7 halo
  2068.       9 GLOCKENSPIEL           52 CHOIR AAHS           95 PAD 8 sweep
  2069.      10 MUSICBOX               53 VOICE OOHS           96 FX1 rain
  2070.      11 VIBRAPHONE             54 SYNTH VOICE          97 FX2 soundtrack
  2071.      12 MARIMBA                55 ORCHESTRA HIT        98 FX3 crystal
  2072.      13 XYLOPHONE              56 TRUMPET              99 FX4 atmosphere
  2073.      14 TUBULAR BELLS          57 TROMBONE            100 FX5 brightness
  2074.      15 DULCIMER               58 TUBA                101 FX6 goblins
  2075.      16 DRAWBAR ORGAN          59 MUTED TRUMPET       102 FX7 echoes
  2076.      17 PERCUSSIVE ORGAN       60 FRENCH HORN         103 FX8 sci-fi
  2077.      18 ROCK ORGAN             61 BRASS SECTION       104 SITAR
  2078.      19 CHURCH ORGAN           62 SYNTHBRASS 1        105 BANJO
  2079.      20 REED ORGAN             63 SYNTHBRASS 2        106 SHAMISEN
  2080.      21 ACCORDION              64 SOPRANO SAX         107 KOTO
  2081.      22 HARMONICA              65 ALTO SAX            108 KALIMBA
  2082.      23 TANGO ACCORDIAN        66 TENOR SAX           109 BAG PIPE
  2083.      24 ACOUSTIC GUITAR nyln   67 BARITONE SAX        110 FIDDLE
  2084.      25 ACOUSTIC GUITAR stl    68 OBOE                111 SHANAI
  2085.      26 ELECTRIC GUITAR jazz   69 ENGLISH HORN        112 TINKLE BELL
  2086.      27 ELECTRIC GUITAR cln    70 BASSOON             113 AGOGO
  2087.      28 ELECTRIC GUITAR mute   71 CLARINET            114 STEEL DRUMS
  2088.      29 OVERDRIVEN GUITAR      72 PICCOLO             115 WOOD BLOCK
  2089.      30 DISTORTION GUITAR      73 FLUTE               116 TAIKO DRUM
  2090.      31 GUITAR HARMONICS       74 RECORDER            117 MELODIC TOM
  2091.      32 ACOUSTIC BASS          75 PAN FLUTE           118 SYNTH DRUM
  2092.      33 ELECTRIC BASS finger   76 BLOWN BOTTLE        119 REVERSE CYMBAL
  2093.      34 ELECTRIC BASS pick     77 SHAKUHACHI          120 GUITAR FRET NOISE
  2094.      35 FRETLESS BASS          78 WHISTLE             121 BREATH NOISE
  2095.      36 SLAP BASS 1            79 OCARINA             122 LOSTINSPACE
  2096.      37 SLAP BASS 2            80 LEAD 1 square       123 BIRD TWEET
  2097.      38 SYNTH BASS 1           81 LEAD 2 sawtooth     124 TELEPHONE RING
  2098.      39 SYNTH BASS 2           82 LEAD 3 calliope     125 HELICOPTER
  2099.      40 VIOLIN                 83 LEAD 4 chiff        126 APPLAUSE
  2100.      41 VIOLA                  84 LEAD 5 charang      127 GUNSHOT
  2101.      42 CELLO                  85 LEAD 6 voice
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.                                                                               32
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.      General MIDI - Level 1 Sound Set Groupings by Program Number.
  2121.  
  2122.      Prog#   Instrument Group     Prog#  Ins Grp      Prog#  Ins Grp
  2123.      ---------------------------------------------------------------------
  2124.       0-7  Piano                  40-47 Strings       80-87  Synth Lead
  2125.       8-15 Chromatic Percussion   48-55 Ensemble      88-95  Synth Pad
  2126.      16-23 Organ                  56-63 Brass         96-103 Synth Effects
  2127.      24-31 Guitar                 64-71 Reed         104-111 Ethnic
  2128.      32-39 Bass                   72-79 Pipe         112-119 Percussive
  2129.                                                      120-127 Sound Effects
  2130.  
  2131.  
  2132.      General MIDI - Level 1 Percussion Map (Channel 9).
  2133.  
  2134.      Key#  Drum Sound       Key#  Drum Sound        Key#  Drum Sound
  2135.      --------------------------------------------------------------------
  2136.       35 Acoustic Bass Drum  51 Ride Cymbal 1        67 High Agogo
  2137.       36 Bass Drum 1         52 Chinese Cymbal       68 Low Agogo
  2138.       37 Side Stick          53 Ride Bell            69 Cabasa
  2139.       38 Acoustic Snare      54 Tambourine           70 Maracas
  2140.       39 Hand Clap           55 Splash Cymbal        71 Short Whistle
  2141.       40 Electric Snare      56 Cowbell              72 Long Whistle
  2142.       41 Low Floor Tom       57 Crash Cymbal 2       73 Short Guiro
  2143.       42 Closed Hi-Hat       58 Vibraslap            74 Long Guiro
  2144.       43 High Floor Tom      59 Ride Cymbal 2        75 Claves
  2145.       44 Pedal Hi-Hat        60 Hi Bongo             76 Hi Wood Block
  2146.       45 Low Tom             61 Low Bongo            77 Low Wood Block
  2147.       46 Open Hi-Hat         62 Mute Hi Conga        78 Mute Cuica
  2148.       47 Low-Mid Tom         63 Open Hi Conga        79 Open Cuica
  2149.       48 Hi-Mid Tom          64 Low Conga            80 Mute Triangle
  2150.       49 Crash Cymbal 1      65 High Timbal          81 Open Triangle
  2151.       50 High Tom            66 Low Timbal
  2152.  
  2153.  
  2154.      For timbre data used by RUCKUS-MIDI for programs 0-127 see the GMPATCH.*
  2155.      file. Also see that file for percussive voice mappings (for example, how
  2156.      percussive channel 9 key# 46, Open Hi-Hat, maps to AdLib percussive
  2157.      voice 10, the Hi-Hat). These files are device-dependent and there is one
  2158.      for each RUCKUS-MIDI supported device. Included only in registered versions
  2159.      of the RUCKUS toolkit.
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.                                                                               33
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.      Appendix G. MT-32 MIDI Sound Set.
  2186.  
  2187.  
  2188.      Sound Set Program Number and Name.
  2189.  
  2190.      Prog#  Instrument        Prog#  Instrument       Prog#  Instrument
  2191.      ------------------------------------------------------------------
  2192.        0 AcouPno1              43 EchoPan              86 Bassoon
  2193.        1 AcouPno2              44 DocSolo              87 Harmonca
  2194.        2 AcouPno3              45 SchlDaze             88 Trumpet1
  2195.        3 ElecPno1              46 BellSing             89 Trumpet2
  2196.        4 ElecPno2              47 SqWave               90 Trombon1
  2197.        5 ElecPno3              48 StrSect1             91 Trombon2
  2198.        6 ElecPno4              49 StrSect2             92 FrHorn1
  2199.        7 HonkTonk              50 StrSect3             93 FrHorn2
  2200.        8 ElecOrg1              51 Pizzicto             94 Tuba
  2201.        9 ElecOrg2              52 Violin1              95 BrsSect1
  2202.       10 ElecOrg3              53 Violin2              96 BrsSect2
  2203.       11 ElecOrg4              54 Cello1               97 Vibes1
  2204.       12 PipeOrg1              55 Cello2               98 Vibes2
  2205.       13 PipeOrg2              56 ContraBs             99 SynMallt
  2206.       14 PipeOrg3              57 Harp1               100 WindBell
  2207.       15 Accordn               58 Harp2               101 Glock
  2208.       16 Harpsi1               59 Guitar1             102 TubeBell
  2209.       17 Harpsi2               60 Guitar2             103 XyloPhon
  2210.       18 Harpsi3               61 ElecGtr1            104 Marimba
  2211.       19 Clavi1                62 ElecGtr2            105 Koto
  2212.       20 Clavi2                63 Sitar               106 Sho
  2213.       21 Clavi3                64 AcouBs1             107 Shakuhch
  2214.       22 Celesta1              65 AcouBs2             108 Whistle1
  2215.       23 Celesta2              66 ElecBs1             109 Whistle2
  2216.       24 SynBrss1              67 ElecBs2             110 BottlBlo
  2217.       25 SynBrss2              68 SlapBs1             111 BreathPp
  2218.       26 SynBrss3              69 SlapBs2             112 Timpani
  2219.       27 SynBrss4              70 Fretls1             113 MelodTom
  2220.       28 SynBass1              71 Fretls2             114 DeepSnar
  2221.       29 SynBass2              72 Flute1              115 Oberheim
  2222.       30 SynBass3              73 Flute2              116 Noise
  2223.       31 SynBass4              74 Piccolo1            117 Taiko
  2224.       32 Fantasy               75 Piccolo2            118 TaikoRim
  2225.       33 HarmoPan              76 Recorder            119 RevCymb
  2226.       34 Chorale               77 PanPipes            120 JawHarp
  2227.       35 Glasses               78 Sax1                121 Triangle
  2228.       36 SoundTrk              79 Sax2                122 OrcheHit
  2229.       37 Atmosphr              80 Sax3                123 BassDrm
  2230.       38 WarmBell              81 Sax4                124 BirdTwt
  2231.       39 FunnyVox              82 Clarint1            125 Banjo
  2232.       40 EchoBell              83 Clarint2            126 MoogSyn
  2233.       41 IceRain               84 Oboe                127 JunglTun
  2234.       42 Oboe2001              85 EngHorn
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.                                                                               34
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.      MT-32 Sound Set Groupings by Program Number.
  2253.  
  2254.      Prog#   Instrument Group     Prog#  Ins Grp      Prog#  Ins Grp
  2255.      ----------------------------------------------------------------------
  2256.      Not specified.
  2257.  
  2258.  
  2259.      MT-32 Percussion Map (Channel 9).
  2260.  
  2261.      Key#  Drum Sound       Key#  Drum Sound        Key#  Drum Sound
  2262.      ----------------------------------------------------------------------
  2263.       35 Acoustic Bass       51 Ride Cymbal 1        67 High Agogo
  2264.       36 Acoustic Bass       52*Chinese Cymbal       68 Low Agogo
  2265.       37 Rim Shot            53*Ride Bell            69 Cabasa
  2266.       38 Acoustic Snare      54 Tambourine           70 Maracas
  2267.       39 Hand Clap           55*Splash Cymbal        71 Short Whistle
  2268.       40 Electric Snare      56 Cowbell              72 Long Whistle
  2269.       41 Acoustic Low Tom    57*Crash Cymbal 2       73 Short Guiro
  2270.       42 Closed High Hat     58*Vibraslap            74*Long Guiro
  2271.       43 Acoustic Low Tom    59*Ride Cymbal 2        75 Claves
  2272.       44 Open High Hat 2     60 Hi Bongo             76*Hi Wood Block
  2273.       45 Acoustic Mid Tom    61 Low Bongo            77*Low Wood Block
  2274.       46 Open High Hat 1     62 Mute Hi Conga        78*Mute Cuica
  2275.       47 Acoustic Mid Tom    63 Open Hi Conga        79*Open Cuica
  2276.       48 Acoustic High Tom   64 Low Conga            80*Mute Triangle
  2277.       49 Crash Cymbal        65 High Timbal          81*Open Triangle
  2278.       50 Acoustic High Tom   66 Low Timbal
  2279.  
  2280.  
  2281.      For timbre data used by RUCKUS-MIDI for programs 0-127 see the MTPATCH.*
  2282.      file. Also see that file for percussive voice mappings (for example, how
  2283.      percussive channel 9 key# 46, Open Hi-Hat, maps to AdLib percussive
  2284.      voice 10, the Hi-Hat). These files are device-dependent and there is one
  2285.      for each RUCKUS-MIDI supported device. Included only in registered versions
  2286.      of the RUCKUS toolkit.
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.                                                                               35
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.      Appendix H. RUCKUS-MIDI Patch Map Format.
  2318.  
  2319.  
  2320.      Format of the patch maps used internally by RUCKUS-MIDI for the 2-operator
  2321.      OPL chip is composed of 2 sections. The header and the timbre data. The
  2322.      header is the first 48 bytes of the data.
  2323.  
  2324.      HEADER:
  2325.        Patch name: 20 bytes
  2326.        Patch size: 1 word, set to 48
  2327.          reserved: 14 bytes
  2328.      TIMBRE DATA for each program (0-127):
  2329.        Instrument name: 20 bytes (may be 0- or space-filled)
  2330.        Instrument data: 28 bytes
  2331.  
  2332.        Instrument data format is:
  2333.  
  2334.      Op0:ksl,multi,fb,ar,sl,eg,dr,rr,tl,amvib,vib,ksr,c
  2335.      Op1:ksl,multi,--,ar,sl,eg,dr,rr,tl,amvib,vib,ksr,-
  2336.          mws,cws (modulator wave shape, carrier wave shape)
  2337.  
  2338.      For example:
  2339.  
  2340.      PATCHES_MT  db 'PATCHES_MT32',0,0,0,0
  2341.      dw 48
  2342.      db 14 DUP(0)
  2343.  
  2344.      db 'ACOUPIANO1',0,0,0,0,0,0,0,0,0,0                   ;(0)
  2345.      db 01h,01h,03h,0Fh,05h,00h,01h,00h,0Fh,00h,00h,00h,01h
  2346.      db 00h,00h,01h,00h,0Dh,07h,00h,03h,0Ch,04h,00h,00h,00h
  2347.      db 00h,00h
  2348.      ;the other patches would follow, to the 127th
  2349.      ;total patch size would be 48+(128*48)=6192 bytes
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.                                                                               36
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.      Internally, RUCKUS-MIDI maintains separate locations for the programs and
  2385.      the percussive map. However, for custom patch maps, the following format
  2386.      must be used:
  2387.  
  2388.      Custom Patch Format:
  2389.  
  2390.      First 48-byte section is the percussive map for key numbers 35 to 82. Key
  2391.      number 82 should map to value 255. For example:
  2392.  
  2393.  
  2394.        ;0  1  2  3  4  5  6  7  8  9 (values in decimal, 48 bytes)
  2395.      db                06,06,08,07,08 ;35-39
  2396.      db 07,08,10,08,10,08,10,08,08,09 ;40-49
  2397.      db 08,09,09,09,10,09,09,09,08,09 ;50-59
  2398.      db 08,08,08,08,08,07,07,07,07,08 ;60-69
  2399.      db 10,10,10,10,10,08,08,08,08,08 ;70-79
  2400.      db 10,10,255                     ;80-81
  2401.  
  2402.      ;In the above map, key# 35 maps to OPL-2 voice 6, the bass drum. Key# 79
  2403.      ;maps to voice 8, the tom-tom.
  2404.  
  2405.      ;This is immediately followed by the program patches as above:
  2406.  
  2407.      PATCHES_MT  db 'PATCHES_MT32',0,0,0,0
  2408.      dw 48
  2409.      db 14 DUP(0)
  2410.  
  2411.      db 'ACOUPIANO1',0,0,0,0,0,0,0,0,0,0                   ;(0)
  2412.      db 01h,01h,03h,0Fh,05h,00h,01h,00h,0Fh,00h,00h,00h,01h
  2413.      db 00h,00h,01h,00h,0Dh,07h,00h,03h,0Ch,04h,00h,00h,00h
  2414.      db 00h,00h
  2415.      ;the other patches would follow, to the 127th
  2416.      ;total patch size would be 48+48+(128*48)=6240 bytes
  2417.  
  2418.      To create custom patch maps for the OPL-2 chip, the shareware package
  2419.      SBKTimbre can be used. To convert the output of this program for use with
  2420.      RUCKUS-MIDI, use the supplied IBK2OPL2.EXE program. The 48-byte percussive
  2421.      map must be constructed by hand. 
  2422.  
  2423.      Note that other devices (when supported) will have different formats. 
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.                                                                               37
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.      Appendix Z. Ordering Information, License Agreement and Product Support.
  2450.  
  2451.      To order you must you the order form included with the distribution files.
  2452.      Its filename is !ORDER.FRM. Orders made without this form may be delayed.
  2453.  
  2454.      There are two RUCKUS packages available. The PERSONAL DEVELOPER version is
  2455.      for the hobby-programmer while the PROFESSIONAL version is for the
  2456.      professional programmer.
  2457.  
  2458.      The PERSONAL DEVELOPER version is for persons that are not creating
  2459.      programs for distribution to others. With the PERSONAL DEVELOPER license
  2460.      you may not distribute any programs you create with RUCKUS. In addition, a
  2461.      sign-on banner is issued once, displaying the RUCKUS copyright and license
  2462.      restriction.
  2463.  
  2464.      The PROFESSIONAL version has no distribution restrictions on end-user
  2465.      programs you create with RUCKUS. The PROFESSIONAL license provides you with
  2466.      the right to create all the end-user programs royalty-free. You also have
  2467.      direct access to the latest version of RUCKUS free-of-charge by way of my
  2468.      support BBS and the RUCKUS Developer's Conference there. No sign-on banner
  2469.      is issued.
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.                                                                               38
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.      License Agreement
  2516.  
  2517.      Before using this software you must agree to the following:
  2518.  
  2519.      1. You are not allowed to operate more than one (1) copy of this software
  2520.      package at one time per license. This means that if you have 10 programmers 
  2521.      that COULD possibly use the RUCKUS library at the same time, you must also  
  2522.      have ten (10) RUCKUS licenses. 
  2523.  
  2524.      2. You are not allowed to distribute non-executable code containing RUCKUS 
  2525.      code. This means that you are not allowed to redistribute RUCKUS code as    
  2526.      another .LIB, for example. Also, if RUCKUS code is to be contained in a    
  2527.      Dynamic Link Library (DLL) then it must be part of a stand-alone product. 
  2528.      This means that you cannot provide a .DLL containing RUCKUS code if that    
  2529.      .DLL is to be used as a programming library for other programmers. If you   
  2530.      wish to distribute non-executable code containing RUCKUS code you must    
  2531.      obtain written permission from the author.
  2532.  
  2533.      3. This license grants you the right to use the RUCKUS library code on a   
  2534.      royalty-free basis, except when the license is the PERSONAL DEVELOPER, in
  2535.      which case you may not distribute any program in which RUCKUS has been
  2536.      used.
  2537.  
  2538.      4. RUCKUS is owned by the author, Cornel Huth, and is protected by United  
  2539.      States copyright laws and international treaty provisions. You are not    
  2540.      allowed to make copies of this software except for archival purposes.
  2541.  
  2542.      5. You may not rent or lease RUCKUS. You may not transfer this license
  2543.      without the written permission of the author. If this software is an update
  2544.      or upgrade, you may not sell or give away previous versions.
  2545.  
  2546.      6. You may not reverse engineer, decompile, or disassemble this software.
  2547.  
  2548.      7. There are no expressed or implied warranties with this software.
  2549.  
  2550.      8. All liabilities in the use of this software rest with the user.
  2551.  
  2552.      9. U.S. Government Restricted Rights. This software is provided with    
  2553.      restricted rights. Use, duplication, or disclosure by the Government is    
  2554.      subject to restrictions as set forth in subparagraph (c)(1)(ii) of the    
  2555.      Rights in Technical Data and Computer Software clause at 52.227-7013.    
  2556.      Manufacturer is Cornel Huth/6402 Ingram Rd/San Antonio, TX 78238.
  2557.  
  2558.      This agreement is governed by the laws of the state of Texas.
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.                                                                               39
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.      Product Support
  2582.  
  2583.      Support is available 7 days/week from 17:00 to 09:00 Central Time at my
  2584.      BBS, the Fortieth Floor, at 1.210.684.8065.
  2585.  
  2586.      PROFESSIONAL version licensees have free access to all future RUCKUS
  2587.      updates and upgrades via the RUCKUS Developer's Conference on the Fortieth
  2588.      Floor BBS (1.210.684.8065). PERSONAL DEVELOPER licensees have restricted
  2589.      access to in-version maintenance updates at no charge.
  2590.  
  2591.      End of the RUCKUS-MIDI DOCUMENT. See also the RUCKUS-DAC DOCUMENT.
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.                                                                               40
  2637.  
  2638.  
  2639.  
  2640.  
  2641.